package zilvic.gui;

import java.awt.Graphics;
import zilvic.game.Game;
import zilvic.gui.battle.BattleScreen;
import zilvic.gui.gamemenu.GameMenuScreen;
import zilvic.gui.mainmenu.MainMenuScreen;
import zilvic.gui.save.SaveScreen;
import zilvic.gui.world.WorldScreen;

/**
 *
 * @author Duncan
 */
public class GUI {
    private static GUI gui;

    public GUI() {
        gui = this;
    }

    private Screen[] screens = new Screen[] {
        new SaveScreen(),
        new BattleScreen(),
        new WorldScreen(),
        new GameMenuScreen(),
        new MainMenuScreen()
    };

    public static final int
            SCREEN_SAVE = 0,
            SCREEN_BATTLE = 1,
            SCREEN_WORLD = 2,
            SCREEN_GAME_MENU = 3,
            SCREEN_MAIN_MENU = 4;

    private int currentScreen = SCREEN_MAIN_MENU;

    public void setCurrentScreen(int newScreen) {
        currentScreen = newScreen;
    }

    public int getCurrentScreen() {
        return currentScreen;
    }

    public GUI step(long delta) {
        screens[getCurrentScreen()].step(delta);
        return this;
    }

    public GUI draw(Graphics g) {
        screens[getCurrentScreen()].draw(g);
        return this;
    }

    public static GUI getGUI() {
        return gui;
    }
}
